#include "zhongzhimanager.h"
#include "QDebug"

Q_GLOBAL_STATIC(ZhongZhiManager, instance)
ZhongZhiManager::ZhongZhiManager()
{
    crops << "小麦" << "苎麻" << "大米" << "草棉" << "玉米" << "亚麻" << "花生"
          << "木棉" << "红薯" << "黄麻" << "高粱" << "云棉" << "芝麻"<< "槿麻"
         << "绿豆" << "绒棉"  << "黄豆" << "青麻" << "蚕豆"  << "彩棉";

    cropType << "早产" << "晚产";
}

ZhongZhiManager *ZhongZhiManager::getInstance()
{
    return instance();
}

QStringList ZhongZhiManager::getCrops()
{
    return crops;
}

QStringList ZhongZhiManager::getCropType()
{
    return cropType;
}

QString ZhongZhiManager::getCorpImg(QString cropName)
{
    if(cropName == "小麦"){
        return ":/zhongzhi/icon/zhongzhi/crop_xiaomai.png";
    }else if(cropName == "大米"){
        return ":/zhongzhi/icon/zhongzhi/crop_dami.png";
    }else if(cropName == "红薯"){
        return ":/zhongzhi/icon/zhongzhi/crop_hongshu.png";
    }else if(cropName == "芝麻"){
        return ":/zhongzhi/icon/zhongzhi/crop_zhima.png";
    }else if(cropName == "黄豆"){
        return ":/zhongzhi/icon/zhongzhi/crop_huangdou.png";
    }else if(cropName == "苎麻"){
        return ":/zhongzhi/icon/zhongzhi/crop_zhuma.png";
    }else if(cropName == "草棉"){
        return ":/zhongzhi/icon/zhongzhi/crop_caomian.png";
    }else if(cropName == "木棉"){
        return ":/zhongzhi/icon/zhongzhi/crop_mumian.png";
    }else if(cropName == "槿麻"){
        return ":/zhongzhi/icon/zhongzhi/crop_jinma.png";
    }else if(cropName == "绿豆"){
        return ":/zhongzhi/icon/zhongzhi/crop_lvdou.png";
    }else if(cropName == "蚕豆"){
        return ":/zhongzhi/icon/zhongzhi/crop_candou.png";
    }else if(cropName == "亚麻"){
        return ":/zhongzhi/icon/zhongzhi/crop_yama.png";
    }else if(cropName == "云棉"){
        return ":/zhongzhi/icon/zhongzhi/crop_yunmian.png";
    }else if(cropName == "青麻"){
        return ":/zhongzhi/icon/zhongzhi/crop_qingma.png";
    }else if(cropName == "彩棉"){
        return ":/zhongzhi/icon/zhongzhi/crop_caimian.png";
    }else if(cropName == "玉米"){
        return ":/zhongzhi/icon/zhongzhi/crop_yumi.png";
    }else if(cropName == "花生"){
        return ":/zhongzhi/icon/zhongzhi/crop_huasheng.png";
    }else if(cropName == "高粱"){
        return ":/zhongzhi/icon/zhongzhi/crop_gaoliang.png";
    }else if(cropName == "黄麻"){
        return ":/zhongzhi/icon/zhongzhi/crop_huangma.png";
    }else if(cropName == "绒棉"){
        return ":/zhongzhi/icon/zhongzhi/crop_rongmian.png";
    }else{
        qDebug() << "未找到农作物对应的图片";
        return "";
    }
}
